﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ViewModels="clr-namespace:ScrumSprintMonitor.Modules.WorkItemMonitor.ViewModels">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="..\DataTemplates\TeamMemberBadgeBaseDataTemplate.xaml"/>
    </ResourceDictionary.MergedDictionaries>

    <DataTemplate DataType="{x:Type ViewModels:TeamMemberViewModel}">
        <ContentPresenter Content="{Binding}" Width="7cm" Height="3cm" HorizontalAlignment="Center" VerticalAlignment="Center">
            <ContentPresenter.Style>
                <Style TargetType="{x:Type ContentPresenter}">
                    <Setter Property="ContentTemplate" Value="{StaticResource TeamMemberBadgeDataTemplate}" />

                    <Style.Triggers>
                        <DataTrigger Binding="{Binding Path=DisplayName}" Value="{x:Null}">
                            <Setter Property="ContentTemplate" Value="{StaticResource UnusedTeamMemberBadgeDataTemplate}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ContentPresenter.Style>
        </ContentPresenter>
    </DataTemplate>
</ResourceDictionary>